﻿using System;
using System.Collections.Generic;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZHDJ.Data.Models.Common;
using ZHDJ.Data.Models.Edu;

namespace ZHDJ.Data.Mapping.Edu
{
    public class PartyEduCoursewareImageMap : EntityTypeConfiguration<PartyEduCoursewareImage>
    {
        public PartyEduCoursewareImageMap()
        {
            
            this.HasOptional(a=>a.PartyEduCourseware).WithMany(a=>a.PartyEduCoursewareImages).HasForeignKey(f => f.CoursewareID);
            this.HasOptional(a => a.PartyFile).WithMany().HasForeignKey(f => f.FileID).WillCascadeOnDelete(false);
            this.HasOptional(a => a.CreateUser)
              .WithMany()
              .HasForeignKey(a => a.CreateBy).WillCascadeOnDelete(false);
            this.HasOptional(a => a.ModifyUser)
              .WithMany()
              .HasForeignKey(a => a.ModifyBy).WillCascadeOnDelete(false);
        }

    }
}
